#include<bits/stdc++.h>
using namespace std;

int gcd(int m, int n)
{
	if(m < n)
		swap(m, n);
	int r;
	while(n)
	{
		r = m%n;
		m = n;
		n = r;
	}
	return m;
}

int main()
{
	int x, y, l;
	cin>>x>>y>>l;
	double t = 1.0*x/y;
	int xx, yy;
	int mnxx, mnyy;
	double dif, mn = 0x3f3f3f3f;
	for(yy = l;yy >= 1;yy--)
	{
		for(xx = l;xx >= 1;xx--)
		{
			dif = 1.0*xx/yy-t;
			if(dif < 0)
				continue;
			if(dif < mn && gcd(xx, yy) == 1)
			{
				mn = dif;
				mnxx = xx;
				mnyy = yy;
			}
		}
	}
	cout<<mnxx<<" "<<mnyy;
	return 0;
}

